package com.niiwoo.civet.trade.dao.mapper;

import com.niiwoo.civet.trade.dao.entity.RefundOrderDetailBiz;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RefundOrderDetailBizMapperExt extends RefundOrderDetailBizMapper {
	
	/**
	 * 还款订单请求流水号查询分帐详情
	 * 
	 * @param projectId
	 * 				标的ID
	 * @param batchNo
	 * 				存管交易流水号
	 * @return
	 */
	List<RefundOrderDetailBiz> selectByProjectIdAndBatchNo(@Param("projectId")Long projectId, @Param("batchNo")String batchNo);

	/**
	 * 标的ID、还款订单ID查询分帐详情
	 *
	 * @param projectId
	 * 				标的ID
	 * @param refundOrderId
	 * 				还款订单ID
	 * @return
	 */
	List<RefundOrderDetailBiz> selectByProjectIdAndRefundOrderId(@Param("projectId")Long projectId, @Param("refundOrderId")Long refundOrderId);

	/**
	 * 还款订单请求流水号查询分帐详情
	 *
	 * @param orderId
	 * 				还款订单请求流水号
	 * @return
	 */
	List<RefundOrderDetailBiz> selectByProjectIdAndOrderId(String orderId);

	/**
	 * 批量插入订单明细biz
	 * @return
	 */
	int batchInsertOrderDetailBiz(List<RefundOrderDetailBiz> refundOrderDetailBizrList);

	/**
	 * 根据明细存管流水号查询还款/垫付业务明细
	 *
	 * @param detailRequestNo
	 * @return
	 */
	List<RefundOrderDetailBiz> queryRefundOrderDetailBizByDetailRequestNo(@Param("detailRequestNo") String detailRequestNo);

	/**
	 * 根据明细存管流水号list查询还款/垫付业务明细
	 *
	 * @param detailRequestNoList
	 * @return
	 */
	List<RefundOrderDetailBiz> queryRefundOrderDetailBizByDetailRequestNoList(@Param("detailRequestNoList") List<String> detailRequestNoList);

	/**
	 * 根据流水号和业务类型查询
	 * @param detailRequestNo
	 * @param bizType
	 * @return List<RefundOrderDetailBiz>
	 */
	List<RefundOrderDetailBiz> queryRefundOrderDetailBizByDetailRequestNOType(@Param("detailRequestNo") String detailRequestNo,@Param("bizType") String bizType);

	RefundOrderDetailBiz getRefundOrderDetailBizByDetailRequestNo(@Param("detailRequestNo") String detailRequestNo);

}